<html>
<meta charset=utf-8/>
<body>
    <p style="text-align:right">
        <form  action="logout.php">
            <?php 
            session_start(); 
            echo '欢迎你'.$_SESSION["name"]; 
            ?>
            <input type="submit" value="退出"/>
        </form>
        <form action='regist.html'>
        <input type="submit" value="修改个人信息"/>
        </form>
    </p>

<?php
header("Content-Type: text/html; charset=utf-8");
include('db-conn.php');
$x="select * from jiuye.user where name='$_SESSION[name]';";
$y=(mysqli_fetch_assoc(mysqli_query($conn,$x)));
if(empty($_SESSION['name']) !== true && $y['s_name'] === $_SESSION['sname'] ){
   //header("location:list.php");
}else{
    echo "<script>alert('请先登录');window.location.href='index.html';</script>";
}

?>
</body>
</html>